package com.cortex.animation;

import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

public class AnimationInOut implements AnimationListener{
	private Animation in,out;
	private View v;
	private boolean isShowEndAnimation = false;

	public AnimationInOut() {

	}
	public AnimationInOut(View v) {
		this.v = v;
	}
	public AnimationInOut(View v,boolean isShowEndAnimation) {
		this.v = v;
		this.isShowEndAnimation = isShowEndAnimation;
	}
	public AnimationInOut(View v,Animation in, Animation out) {
		this.v = v;
		this.in = in;
		this.out = out;
	}
	public AnimationInOut(View v,boolean isShowEndAnimation,Animation in, Animation out) {
		this.v = v;
		this.in = in;
		this.out = out;
		this.isShowEndAnimation = isShowEndAnimation;
	}
	public View getV() {
		return v;
	}
	public void setV(View v) {
		this.v = v;
	}
	public Animation getIn() {
		return in;
	}

	public void setIn(Animation in) {
		this.in = in;
	}

	public Animation getOut() {
		return out;
	}

	public void setOut(Animation out) {
		this.out = out;
	}
	public boolean isShowEndAnimation() {
		return isShowEndAnimation;
	}
	public void setShowEndAnimation(boolean isShowEndAnimation) {
		this.isShowEndAnimation = isShowEndAnimation;
	}
	@Override
	public void onAnimationEnd(Animation animation) {
		v.setVisibility(isShowEndAnimation?View.VISIBLE:View.INVISIBLE);
	}

	@Override
	public void onAnimationRepeat(Animation animation) {

	}

	@Override
	public void onAnimationStart(Animation animation) {
		v.setVisibility(View.VISIBLE);
	}
}